#pragma once

//C
#include <cstring>
#include <cassert>
#include <errno.h>
#include <time.h>
#include <sys/timeb.h>

//stl
#include <vector>
#include <list>
#include <set>
#include <map>
#include <memory>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <cstdint>
#include <thread>
#include <tuple>
#include <functional>
#include <chrono>
#include <mutex>
#include <condition_variable>
#include <unordered_set>
#include <unordered_map>

//sys
#ifdef MSVC

#include <process.h>
#include <winsock2.h>
#include <io.h>
#include <direct.h>
#include <shlwapi.h>

#pragma comment(lib, "shlwapi.lib")
#pragma warning(disable:4251)

#define STDCALL __stdcall
#define __THREAD__ static_cast<int32_t>(GetCurrentThreadId())

#else

#include <unistd.h>
#include <dirent.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/timeb.h>
#include <sys/syscall.h>
#include <sys/socket.h> 
#include <sys/epoll.h>

#define STDCALL
#define __THREAD__ static_cast<int32_t>(syscall(__NR_gettid))

#endif

#define __SLEEP__(n) std::this_thread::sleep_for(std::chrono::milliseconds(n))
